import { Dialog, Toast } from 'vant';
class Async {
  confirm({ message }) {
    return new Promise((resolve, reject) => {
      Dialog.confirm({
        title: '标题',
        message
      })
        .then(async () => {
          resolve();
        })
        .catch(() => {
          Toast('已取消删除');
          reject();
        });
    });
  }
  delay(time) {
    return new Promise((resolve, reject) => {
      let uid = setTimeout(() => {
        clearTimeout(uid);
        resolve();
      }, time);
    });
  }
}
export default new Async();
